package dk.pun.aot.client.event;

import com.google.gwt.event.shared.GwtEvent;

import dk.pun.aot.client.dice.DiceRoll;

public class DiceRolledEvent extends GwtEvent<DiceRolledEventHandler> {

	public static Type<DiceRolledEventHandler> TYPE = new Type<DiceRolledEventHandler>();

	private final DiceRoll diceRoll;

	public DiceRolledEvent(DiceRoll diceRoll) {
		this.diceRoll = diceRoll;
	}

	public DiceRoll getDiceRoll() {
		return this.diceRoll;
	}

	@Override
	public Type<DiceRolledEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(DiceRolledEventHandler handler) {
		handler.onDiceRolled(this);
	}

}
